package com.ruoyi.mes.controller;



import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mes.service.IndexService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.controller.BaseController;

/**
 * 首页Controller
 *
 * @author LongAndHao
 * @date 2023-04-04
 */
@Api(tags = "首页")
@RestController
@RequestMapping("/mes/index")
public class IndexController extends BaseController
{

    @Autowired
    private IndexService indexService;

    /**
     * 当日订单情况
     * @return
     */
    @GetMapping("/orderFacts")
    public AjaxResult orderFacts(){
        return success(indexService.orderFacts());
    }

    /**
     * 上一周订单数
     * @return
     */
    @GetMapping("/lastWeekProOrders")
    public AjaxResult lastWeekProOrders(){
        return success(indexService.lastWeekProOrders());
    }

}

